package com.shiyipicture.shiyipicturebackend.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.shiyipicture.shiyipicturebackend.api.aliyun.model.CreateOutPaintingTaskRequest;
import com.shiyipicture.shiyipicturebackend.api.aliyun.model.CreateOutPaintingTaskResponse;
import com.shiyipicture.shiyipicturebackend.model.dto.picture.*;
import com.shiyipicture.shiyipicturebackend.model.dto.user.UserQueryRequest;
import com.shiyipicture.shiyipicturebackend.model.entity.Picture;
import com.baomidou.mybatisplus.extension.service.IService;
import com.shiyipicture.shiyipicturebackend.model.entity.User;
import com.shiyipicture.shiyipicturebackend.model.vo.PictureVO;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author Administrator
* @description 针对表【picture(图片)】的数据库操作Service
* @createDate 2025-01-06 15:15:24
*/
public interface PictureService extends IService<Picture> {

  PictureVO uploadPicture(Object inputSource, PictureUploadRequest pictureUploadRequest, User loginUser);


  QueryWrapper<Picture> getQueryWrapper(PictureQueryRequest pictureQueryRequest);

  PictureVO getPictureVO(Picture picture, HttpServletRequest request);

  Page<PictureVO> getPictureVOPage(Page<Picture> picturePage, HttpServletRequest request);

  void validPicture(Picture picture);

  /**
   * 图片审核
   * @param pictureReviewRequest
   * @param loginUser
   */
  void doPictureReview(PictureReviewRequest pictureReviewRequest,User loginUser);

  void fillReviewParams(Picture picture, User loginUser);

  int uploadPictureByBatch(PictureUploadByBatchRequest pictureUploadByBatchRequest,User loginUser);

  void checkPictureAuth(User loginUser,Picture picture);

  boolean deletePicture(Long pictureId,User loginUser);

  void clearPictureFile(Picture oldPicture);

  void editPicture(PictureEditRequest pictureEditRequest,User loginUser);

  List<PictureVO> searchPictureByColor(Long spaceId, String picColor, User loginUser);

  void editPictureByBatch(PictureEditByBatchRequest pictureEditByBatchRequest, User loginUser);

  CreateOutPaintingTaskResponse createOutPaintingTask(CreatePictureOutPaintingTaskRequest createPictureOutPaintingTaskRequest, User loginUser);
}
